/*
 * cursor.cpp
 *
 *  Created on: 19/12/2008
 *      Author: smaxll
 */

#include "cursor.hpp"
#include "SDL.h"

#include <iostream>
#include <vector>


namespace {
// Cache the cursors as they are used in programs very often
SDL_Cursor* cache[cursor::NUM_CURSORS] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};

cursor::CURSOR_TYPE current_cursor = cursor::NORMAL;

// This array MUST have members corresponding to cursor::CURSOR_TYPE enum members
const std::string bw_images[cursor::NUM_CURSORS] = { "normal.png", "wait.png", "move.png", "attack.png", "select.png", "move_drag.png", "attack_drag.png", "no_cursor.png"};

}

static SDL_Cursor* get_cursor(cursor::CURSOR_TYPE type){

}

namespace cursor {

/**
 * Set the current cursor according to the parameter "type"
 */
void set(CURSOR_TYPE type){
    // Change only if it's a valid cursor
    if(type != cursor::NUM_CURSORS){
        current_cursor = type;
    } else if (type == cursor::NUM_CURSORS){
        // Except if the current one is also invalid.
        // In this case, change to a valid one.
        current_cursor = cursor::NORMAL;
    }
}

}
